Do not use Checkboxes for user without deletelogentry in log
authorumherirrender <umherirrender_de.wp@web.de>
Fri, 21 Sep 2012 13:16:29 +0000 (15:16 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Fri, 21 Sep 2012 13:16:29 +0000 (15:16 +0200)
When a user has only deletedhistory and not deletelogentry he should not
see checkboxes, because the button at the begin of the page is missing
and than the checkbox is useless. Use links instead, as the history page
does.

Change-Id: Icae8267dcf3032437eae08372ddbe5769bed7a86

includes/logging/LogEventsList.php

index 4de1a97..c478b43 100644 (file)
@@ -351,9 +351,9 @@ class LogEventsList extends ContextSource {
                $user = $this->getUser();
                // Don't show useless checkbox to people who cannot hide log entries
                if( $user->isAllowed( 'deletedhistory' ) ) {
-                       if( $row->log_deleted || $user->isAllowed( 'deletelogentry' ) ) {
-                               $canHide = $user->isAllowed( 'deletelogentry' );
-                               if ( $this->flags & self::USE_REVDEL_CHECKBOXES ) { // Show checkboxes instead of links.
+                       $canHide = $user->isAllowed( 'deletelogentry' );
+                       if( $row->log_deleted || $canHide ) {
+                               if ( $canHide && $this->flags & self::USE_REVDEL_CHECKBOXES ) { // Show checkboxes instead of links.
                                        if ( !self::userCan( $row, LogPage::DELETED_RESTRICTED, $user ) ) { // If event was hidden from sysops
                                                $del = Xml::check( 'deleterevisions', false, array( 'disabled' => 'disabled' ) );
                                        } else {